let cCodes = [
    {
        add: 1,
        code: '#include "stdio.h"',
    },
    {
        add: 2,
        code: 'int f(int n) {',
        anime: async () => {},
    },
    {
        add: 3,
        code: '\tif (n <= 0) return 0;',
        anime: async () => {},
    },
    {
        add: 4,
        code: '\tif (n == 1 || n == 2) return 1;',
        anime: async () => {},
    },
    {
        add: 5,
        code: '\treturn f(n - 1) + f(n - 2);',
        anime: async () => {},
    },
    {
        add: 6,
        code: '}',
    },
    {
        add: 7,
        code: 'int main() {',
    },
    {
        add: 8,
        code: `\tint i = f(${globalConfig.an})`,
        anime: async () => {},
    },
    {
        add: 9,
        code: '\tprintf("%d\n",i);',
        anime: async () => {},
    },
    {
        add: 10,
        code: '\treturn 0;',
        anime: async () => {},
    },
    {
        add: 11,
        code: '}',
    },
]

let cCodeAction = {
    pc: 7,
    async setPC(lineNum) {
        this.pc = lineNum
        return anime({
            targets: '.curr-code-pointer',
            top: lineNum * 25,
            left: 60,
            width: 410,
            easing: 'easeOutCubic',
            duration: 500 * globalConfig.speed,
        }).finished
    },
    async pointerAnim(obj) {
        return anime({
            targets: '.curr-code-pointer',
            easing: 'easeOutCubic',
            duration: 500 * globalConfig.speed,
            ...obj,
        }).finished
    },
    async nextPC() {
        await this.setPC(this.pc + 1)
    },
}
